The present invention relates to the field of video processing. More specifically, the present invention relates to methods, apparatus, and systems for modifying the data rate of a video stream.
In cable systems, multiple compressed video programs are combined to form multiplexes. Each multiplex is transmitted over a fixed-bandwidth channel to a network of receivers. Typically, a receiver decodes and displays one or more video programs by first tuning to a radio frequency corresponding to a selected multiplex, and then extracting the packets corresponding to the one or more selected programs.
It is desirable to maximize the number of digitally compressed programs which can be transmitted over the available fixed-bandwidth channels. One way to increase the number of video programs is to improve the efficiency of the video compression process. Utilizing the most advanced video compression algorithms is desirable, but it is difficult to upgrade an installed base of video receivers. One way to improve the efficiency of a video compression system while maintaining compatibility with an installed base of network receivers, is to utilize variable bit-rate (VBR) encoding. With VBR, the compression ratio is increased when a particular scene is easily compressed, and similarly the compression ratio is reduced when a particular scene is complex and more difficult to compress. By allowing the instantaneous bit rate to vary in this way, VBR encoders are able to deliver more uniform video quality while encoding at a lower average bit rate.
Although VBR encoders are more efficient than constant bit-rate (CBR) encoders, it is more difficult to combine compressed VBR programs into multiplexes. If the multiplex is to be transmitted over a fixed-bandwidth channel, then the instantaneous data rate of the multiplex cannot exceed the data-rate capacity of the channel. In fact, if the goal is to maximize image quality at all times, then the aggregate multiplex data rate should remain constant at a rate matching the full capacity of the channel. Statistical multiplexers are designed to achieve this result by broadcasting a “quality” setting to each VBR encoder. Assuming equal priorities among video encoders, the same quality setting would be conveyed to each, and the quality setting would be adjusted from time to time in order to maintain the desired aggregate data rate.
In many cases, video multiplexers are not co-located with the video encoders, or the programs to be multiplexed are pre-encoded, and therefore the encoding process cannot be regulated in order to achieve a desired aggregate data rate. If the compressed programs were generated using VBR encoders, then it can be difficult to insure that the aggregate data rate of each multiplex remains within the capacity of each corresponding communication channel. This problem is often addressed by utilizing sophisticated multiplexers with transrating capabilities. By coupling a transrater to some or all programs comprising a particular multiplex, it becomes possible to selectively reduce the date rate of the video programs. Such systems are often referred to as statistical remultipexers. In simple terms, a statistical remultiplexer reduces the bit rate of elementary video streams to be able to pack more elementary streams in a given transport stream. The MPEG standards allow requantization of existing video streams to achieve bit rate reduction. The level of quantization does not need to be fixed or constant. It is also unlikely that all the different streams peak, in terms of bitrate, at the same time. Statistics based algorithms could be deployed to calculate a level of quantization for each stream such that the transport stream bandwidth is utilized to its fullest while maintaining highest possible quality. There are many different ways to calculate such a level of quantization. An efficient statistical remultiplexer is able to maximize the quality of each program in the multiplex, while insuring that the aggregate data rate remains within the capacity of the channel at all times.
FIG. 1 shows an example of a simple prior art video transrater 40 that may be used with such statistical multiplexers. The transrater 40 is compatible with compression standards such as MPEG-1, MPEG-2 or H.264. The variable length decoder (VLD) module 42 receives a series of variable length codewords and reconstructs the quantized transform coefficients which these codewords represent. The inverse quantizer (IQ) module 44 performs an inverse quantization step in order to restore the proper scale and range to each transform coefficient. The quantizer (Q) module 46 rescales the transform coefficients once again, but this time the amount of quantization is controlled in order to maintain the desired output data rate. Finally, the variable length encoder (VLE) module 48 further compresses the quantized transform coefficients by representing them as a series of variable-length codewords.
With the prior art transrater 40 of FIG. 1, the accuracy of the recompressed video signal begins to diverge due to the predictive coding components of the compression process. That is, as inaccuracies are introduced by the quantizer module 46, the resulting artifacts can become magnified when information derived from the resulting quantized coefficients is used to predict new information in a subsequent video frame. This shortcoming of the prior art transrater 40 is addressed by the modified prior art transrating system 50 shown in FIG. 2.
In the prior art transrating system 50 shown in FIG. 2, the VLD module 42, the IQ module 44, the Q module 46, and the VLE module 48 function as discussed above in connection with FIG. 1. However, in the system 50 shown in FIG. 2, the quantization errors introduced by the transrating process (in particular by the quantization module 46) are provided at the output of adder 52 as a result of subtracting the transform coefficients obtained from IQ module 51 from the transform coefficients obtained from adder 58. Blocks of transform coefficients from adder 52 are then converted back to the pixel domain by inverse discrete cosine transform (IDCT) module 53 and the resulting pixel errors are then stored in DRAM 55, which is controlled by DRAM controller 54. Pixel errors are retrieved by the motion compensator (MC) module 56 when needed for the prediction of other pixels in nearby image frames and are again converted to the coefficient domain by a discrete cosine transform (DCT) module 57. This result is added to the stream of incoming transform coefficients at adder 58, which prevents the accumulation of the requantization artifacts at Q module 46.
The prior art transrating system shown in FIG. 2 is representative of many predictive, transform based coders such as MPEG-1, MPEG-2, and H.264. Other compression systems may conform to the same structure, but may include additional steps, or alternative versions of the same modules.
The disadvantages of the prior art motion compensated transrating system shown in FIG. 2 are the increased complexity and cost of the additional hardware, and the compression inefficiencies resulting from the introduction of error compensation data at the output of the motion compensated tracking loop. Complexity is also introduced since DCTs, IDCTs, and motion compensators are generally implemented by processing all coefficients or pixels of every block. In contrast, it is only necessary to process the non-zero coefficients, and scan order conversions may be ignored, when implementing the open-loop transrater in FIG. 1. This simplifies implementations by permitting the use of narrower data buses while maintaining higher throughputs.
It would be advantageous to provide a transrating system which provides the benefit the drift correction provided by a closed-loop transrater while minimizing the disadvantages thereof. It would also be advantageous to provide a hybrid transrating system which provides the benefits of both a closed-loop transrater and an open-loop transrater.
The methods and apparatus of the present invention provide the foregoing and other advantages.